
callback:     file format elf64-littleaarch64


Disassembly of section .init:

00000000004004f8 <_init>:
  4004f8:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  4004fc:	910003fd 	mov	x29, sp
  400500:	94000042 	bl	400608 <call_weak_fn>
  400504:	a8c17bfd 	ldp	x29, x30, [sp], #16
  400508:	d65f03c0 	ret

Disassembly of section .plt:

0000000000400510 <.plt>:
  400510:	a9bf7bf0 	stp	x16, x30, [sp, #-16]!
  400514:	90000090 	adrp	x16, 410000 <__FRAME_END__+0xf638>
  400518:	f947fe11 	ldr	x17, [x16, #4088]
  40051c:	913fe210 	add	x16, x16, #0xff8
  400520:	d61f0220 	br	x17
  400524:	d503201f 	nop
  400528:	d503201f 	nop
  40052c:	d503201f 	nop

0000000000400530 <__libc_start_main@plt>:
  400530:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400534:	f9400211 	ldr	x17, [x16]
  400538:	91000210 	add	x16, x16, #0x0
  40053c:	d61f0220 	br	x17

0000000000400540 <strcat@plt>:
  400540:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400544:	f9400611 	ldr	x17, [x16, #8]
  400548:	91002210 	add	x16, x16, #0x8
  40054c:	d61f0220 	br	x17

0000000000400550 <__gmon_start__@plt>:
  400550:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400554:	f9400a11 	ldr	x17, [x16, #16]
  400558:	91004210 	add	x16, x16, #0x10
  40055c:	d61f0220 	br	x17

0000000000400560 <abort@plt>:
  400560:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400564:	f9400e11 	ldr	x17, [x16, #24]
  400568:	91006210 	add	x16, x16, #0x18
  40056c:	d61f0220 	br	x17

0000000000400570 <puts@plt>:
  400570:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400574:	f9401211 	ldr	x17, [x16, #32]
  400578:	91008210 	add	x16, x16, #0x20
  40057c:	d61f0220 	br	x17

0000000000400580 <free@plt>:
  400580:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400584:	f9401611 	ldr	x17, [x16, #40]
  400588:	9100a210 	add	x16, x16, #0x28
  40058c:	d61f0220 	br	x17

0000000000400590 <strcpy@plt>:
  400590:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400594:	f9401a11 	ldr	x17, [x16, #48]
  400598:	9100c210 	add	x16, x16, #0x30
  40059c:	d61f0220 	br	x17

00000000004005a0 <strncpy@plt>:
  4005a0:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  4005a4:	f9401e11 	ldr	x17, [x16, #56]
  4005a8:	9100e210 	add	x16, x16, #0x38
  4005ac:	d61f0220 	br	x17

00000000004005b0 <printf@plt>:
  4005b0:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  4005b4:	f9402211 	ldr	x17, [x16, #64]
  4005b8:	91010210 	add	x16, x16, #0x40
  4005bc:	d61f0220 	br	x17

Disassembly of section .text:

00000000004005c0 <_start>:
  4005c0:	d280001d 	mov	x29, #0x0                   	// #0
  4005c4:	d280001e 	mov	x30, #0x0                   	// #0
  4005c8:	aa0003e5 	mov	x5, x0
  4005cc:	f94003e1 	ldr	x1, [sp]
  4005d0:	910023e2 	add	x2, sp, #0x8
  4005d4:	910003e6 	mov	x6, sp
  4005d8:	580000c0 	ldr	x0, 4005f0 <_start+0x30>
  4005dc:	580000e3 	ldr	x3, 4005f8 <_start+0x38>
  4005e0:	58000104 	ldr	x4, 400600 <_start+0x40>
  4005e4:	97ffffd3 	bl	400530 <__libc_start_main@plt>
  4005e8:	97ffffde 	bl	400560 <abort@plt>
  4005ec:	00000000 	.inst	0x00000000 ; undefined
  4005f0:	00400858 	.word	0x00400858
  4005f4:	00000000 	.word	0x00000000
  4005f8:	004008f0 	.word	0x004008f0
  4005fc:	00000000 	.word	0x00000000
  400600:	00400968 	.word	0x00400968
  400604:	00000000 	.word	0x00000000

0000000000400608 <call_weak_fn>:
  400608:	90000080 	adrp	x0, 410000 <__FRAME_END__+0xf638>
  40060c:	f947f000 	ldr	x0, [x0, #4064]
  400610:	b4000040 	cbz	x0, 400618 <call_weak_fn+0x10>
  400614:	17ffffcf 	b	400550 <__gmon_start__@plt>
  400618:	d65f03c0 	ret
  40061c:	00000000 	.inst	0x00000000 ; undefined

0000000000400620 <deregister_tm_clones>:
  400620:	b0000081 	adrp	x1, 411000 <__libc_start_main@GLIBC_2.17>
  400624:	b0000080 	adrp	x0, 411000 <__libc_start_main@GLIBC_2.17>
  400628:	91016021 	add	x1, x1, #0x58
  40062c:	91016000 	add	x0, x0, #0x58
  400630:	91001c21 	add	x1, x1, #0x7
  400634:	cb000021 	sub	x1, x1, x0
  400638:	f100383f 	cmp	x1, #0xe
  40063c:	540000a9 	b.ls	400650 <deregister_tm_clones+0x30>  // b.plast
  400640:	580000c1 	ldr	x1, 400658 <deregister_tm_clones+0x38>
  400644:	b4000061 	cbz	x1, 400650 <deregister_tm_clones+0x30>
  400648:	d61f0020 	br	x1
  40064c:	d503201f 	nop
  400650:	d65f03c0 	ret
  400654:	d503201f 	nop
	...

0000000000400660 <register_tm_clones>:
  400660:	b0000081 	adrp	x1, 411000 <__libc_start_main@GLIBC_2.17>
  400664:	b0000080 	adrp	x0, 411000 <__libc_start_main@GLIBC_2.17>
  400668:	91016021 	add	x1, x1, #0x58
  40066c:	91016000 	add	x0, x0, #0x58
  400670:	cb000021 	sub	x1, x1, x0
  400674:	9343fc21 	asr	x1, x1, #3
  400678:	8b41fc21 	add	x1, x1, x1, lsr #63
  40067c:	9341fc21 	asr	x1, x1, #1
  400680:	b4000081 	cbz	x1, 400690 <register_tm_clones+0x30>
  400684:	580000a2 	ldr	x2, 400698 <register_tm_clones+0x38>
  400688:	b4000042 	cbz	x2, 400690 <register_tm_clones+0x30>
  40068c:	d61f0040 	br	x2
  400690:	d65f03c0 	ret
  400694:	d503201f 	nop
	...

00000000004006a0 <__do_global_dtors_aux>:
  4006a0:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  4006a4:	910003fd 	mov	x29, sp
  4006a8:	f9000bf3 	str	x19, [sp, #16]
  4006ac:	b0000093 	adrp	x19, 411000 <__libc_start_main@GLIBC_2.17>
  4006b0:	39416260 	ldrb	w0, [x19, #88]
  4006b4:	35000080 	cbnz	w0, 4006c4 <__do_global_dtors_aux+0x24>
  4006b8:	97ffffda 	bl	400620 <deregister_tm_clones>
  4006bc:	52800020 	mov	w0, #0x1                   	// #1
  4006c0:	39016260 	strb	w0, [x19, #88]
  4006c4:	f9400bf3 	ldr	x19, [sp, #16]
  4006c8:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4006cc:	d65f03c0 	ret

00000000004006d0 <frame_dummy>:
  4006d0:	90000080 	adrp	x0, 410000 <__FRAME_END__+0xf638>
  4006d4:	91380000 	add	x0, x0, #0xe00
  4006d8:	f9400001 	ldr	x1, [x0]
  4006dc:	b5000061 	cbnz	x1, 4006e8 <frame_dummy+0x18>
  4006e0:	17ffffe0 	b	400660 <register_tm_clones>
  4006e4:	d503201f 	nop
  4006e8:	58000101 	ldr	x1, 400708 <frame_dummy+0x38>
  4006ec:	b4ffffa1 	cbz	x1, 4006e0 <frame_dummy+0x10>
  4006f0:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  4006f4:	910003fd 	mov	x29, sp
  4006f8:	d63f0020 	blr	x1
  4006fc:	a8c17bfd 	ldp	x29, x30, [sp], #16
  400700:	17ffffd8 	b	400660 <register_tm_clones>
  400704:	d503201f 	nop
	...

0000000000400710 <callback_cpy>:
#include <string.h>

typedef int (*function) (char *, char *);

int callback_cpy(char *des, char *src)
{
  400710:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400714:	910003fd 	mov	x29, sp
  400718:	f9000fa0 	str	x0, [x29, #24]
  40071c:	f9000ba1 	str	x1, [x29, #16]
	strcpy(des, src);
  400720:	f9400ba1 	ldr	x1, [x29, #16]
  400724:	f9400fa0 	ldr	x0, [x29, #24]
  400728:	97ffff9a 	bl	400590 <strcpy@plt>
}
  40072c:	d503201f 	nop
  400730:	a8c27bfd 	ldp	x29, x30, [sp], #32
  400734:	d65f03c0 	ret

0000000000400738 <callback_ncpy>:

int callback_ncpy(char *des, char *src)
{
  400738:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  40073c:	910003fd 	mov	x29, sp
  400740:	f9000fa0 	str	x0, [x29, #24]
  400744:	f9000ba1 	str	x1, [x29, #16]
	strcpy(src, "modified");
  400748:	f9400ba2 	ldr	x2, [x29, #16]
  40074c:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  400750:	91262001 	add	x1, x0, #0x988
  400754:	aa0203e0 	mov	x0, x2
  400758:	f9400022 	ldr	x2, [x1]
  40075c:	f9000002 	str	x2, [x0]
  400760:	39402021 	ldrb	w1, [x1, #8]
  400764:	39002001 	strb	w1, [x0, #8]
	strncpy(des, src, 8);
  400768:	d2800102 	mov	x2, #0x8                   	// #8
  40076c:	f9400ba1 	ldr	x1, [x29, #16]
  400770:	f9400fa0 	ldr	x0, [x29, #24]
  400774:	97ffff8b 	bl	4005a0 <strncpy@plt>
	des[8] = '\0';
  400778:	f9400fa0 	ldr	x0, [x29, #24]
  40077c:	91002000 	add	x0, x0, #0x8
  400780:	3900001f 	strb	wzr, [x0]
}
  400784:	d503201f 	nop
  400788:	a8c27bfd 	ldp	x29, x30, [sp], #32
  40078c:	d65f03c0 	ret

0000000000400790 <test_other>:

void test_other(function fun)
{
  400790:	a9bb7bfd 	stp	x29, x30, [sp, #-80]!
  400794:	910003fd 	mov	x29, sp
  400798:	f9000fa0 	str	x0, [x29, #24]
	char a[20];
	char b[20] = "xiaozhi";
  40079c:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  4007a0:	91268000 	add	x0, x0, #0x9a0
  4007a4:	f9400000 	ldr	x0, [x0]
  4007a8:	f90013a0 	str	x0, [x29, #32]
  4007ac:	f90017bf 	str	xzr, [x29, #40]
  4007b0:	b90033bf 	str	wzr, [x29, #48]

	if (fun){
  4007b4:	f9400fa0 	ldr	x0, [x29, #24]
  4007b8:	f100001f 	cmp	x0, #0x0
  4007bc:	540000a0 	b.eq	4007d0 <test_other+0x40>  // b.none
		fun(a, b);
  4007c0:	910083a1 	add	x1, x29, #0x20
  4007c4:	9100e3a0 	add	x0, x29, #0x38
  4007c8:	f9400fa2 	ldr	x2, [x29, #24]
  4007cc:	d63f0040 	blr	x2
	}

	printf("a = %s\n", a);
  4007d0:	9100e3a1 	add	x1, x29, #0x38
  4007d4:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  4007d8:	91266000 	add	x0, x0, #0x998
  4007dc:	97ffff75 	bl	4005b0 <printf@plt>
}
  4007e0:	d503201f 	nop
  4007e4:	a8c57bfd 	ldp	x29, x30, [sp], #80
  4007e8:	d65f03c0 	ret

00000000004007ec <r_test>:

void r_test(function fun)
{
  4007ec:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  4007f0:	910003fd 	mov	x29, sp
  4007f4:	f9000fa0 	str	x0, [x29, #24]
	test_other(fun);
  4007f8:	f9400fa0 	ldr	x0, [x29, #24]
  4007fc:	97ffffe5 	bl	400790 <test_other>
}
  400800:	d503201f 	nop
  400804:	a8c27bfd 	ldp	x29, x30, [sp], #32
  400808:	d65f03c0 	ret

000000000040080c <test>:

void test(char *a, char *b, int (*fun)(char *c, char *d))
{
  40080c:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  400810:	910003fd 	mov	x29, sp
  400814:	f90017a0 	str	x0, [x29, #40]
  400818:	f90013a1 	str	x1, [x29, #32]
  40081c:	f9000fa2 	str	x2, [x29, #24]
	strcat(a, b);
  400820:	f94013a1 	ldr	x1, [x29, #32]
  400824:	f94017a0 	ldr	x0, [x29, #40]
  400828:	97ffff46 	bl	400540 <strcat@plt>
	printf("%s\n", a);
  40082c:	f94017a0 	ldr	x0, [x29, #40]
  400830:	97ffff50 	bl	400570 <puts@plt>

	fun(a,b);
  400834:	f9400fa2 	ldr	x2, [x29, #24]
  400838:	f94013a1 	ldr	x1, [x29, #32]
  40083c:	f94017a0 	ldr	x0, [x29, #40]
  400840:	d63f0040 	blr	x2
	printf("%s\n", a);
  400844:	f94017a0 	ldr	x0, [x29, #40]
  400848:	97ffff4a 	bl	400570 <puts@plt>
}
  40084c:	d503201f 	nop
  400850:	a8c37bfd 	ldp	x29, x30, [sp], #48
  400854:	d65f03c0 	ret

0000000000400858 <main>:



int main()
{
  400858:	a9b67bfd 	stp	x29, x30, [sp, #-160]!
  40085c:	910003fd 	mov	x29, sp
	char buf[128] = "xiaozhi";
  400860:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  400864:	91268000 	add	x0, x0, #0x9a0
  400868:	f9400000 	ldr	x0, [x0]
  40086c:	f9000fa0 	str	x0, [x29, #24]
  400870:	a9027fbf 	stp	xzr, xzr, [x29, #32]
  400874:	a9037fbf 	stp	xzr, xzr, [x29, #48]
  400878:	a9047fbf 	stp	xzr, xzr, [x29, #64]
  40087c:	a9057fbf 	stp	xzr, xzr, [x29, #80]
  400880:	a9067fbf 	stp	xzr, xzr, [x29, #96]
  400884:	a9077fbf 	stp	xzr, xzr, [x29, #112]
  400888:	a9087fbf 	stp	xzr, xzr, [x29, #128]
  40088c:	f9004bbf 	str	xzr, [x29, #144]
	char *p;

	test_other(callback_cpy);
  400890:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  400894:	911c4000 	add	x0, x0, #0x710
  400898:	97ffffbe 	bl	400790 <test_other>
	test_other(callback_ncpy);
  40089c:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  4008a0:	911ce000 	add	x0, x0, #0x738
  4008a4:	97ffffbb 	bl	400790 <test_other>

	test(buf, "wise", callback_cpy);
  4008a8:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  4008ac:	911c4002 	add	x2, x0, #0x710
  4008b0:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  4008b4:	9126e001 	add	x1, x0, #0x9b8
  4008b8:	910063a0 	add	x0, x29, #0x18
  4008bc:	97ffffd4 	bl	40080c <test>

	r_test(callback_cpy);
  4008c0:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  4008c4:	911c4000 	add	x0, x0, #0x710
  4008c8:	97ffffc9 	bl	4007ec <r_test>
		
	free(p);
  4008cc:	f9404fa0 	ldr	x0, [x29, #152]
  4008d0:	97ffff2c 	bl	400580 <free@plt>
	p = "xiaozhi";
  4008d4:	90000000 	adrp	x0, 400000 <_init-0x4f8>
  4008d8:	91270000 	add	x0, x0, #0x9c0
  4008dc:	f9004fa0 	str	x0, [x29, #152]

	return 0;
  4008e0:	52800000 	mov	w0, #0x0                   	// #0
}
  4008e4:	a8ca7bfd 	ldp	x29, x30, [sp], #160
  4008e8:	d65f03c0 	ret
  4008ec:	00000000 	.inst	0x00000000 ; undefined

00000000004008f0 <__libc_csu_init>:
  4008f0:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
  4008f4:	910003fd 	mov	x29, sp
  4008f8:	a9025bf5 	stp	x21, x22, [sp, #32]
  4008fc:	90000095 	adrp	x21, 410000 <__FRAME_END__+0xf638>
  400900:	a90153f3 	stp	x19, x20, [sp, #16]
  400904:	90000094 	adrp	x20, 410000 <__FRAME_END__+0xf638>
  400908:	9137c2b5 	add	x21, x21, #0xdf0
  40090c:	9137e294 	add	x20, x20, #0xdf8
  400910:	cb150294 	sub	x20, x20, x21
  400914:	a90363f7 	stp	x23, x24, [sp, #48]
  400918:	aa0203f6 	mov	x22, x2
  40091c:	2a0003f8 	mov	w24, w0
  400920:	aa0103f7 	mov	x23, x1
  400924:	97fffef5 	bl	4004f8 <_init>
  400928:	9343fe94 	asr	x20, x20, #3
  40092c:	b4000154 	cbz	x20, 400954 <__libc_csu_init+0x64>
  400930:	d2800013 	mov	x19, #0x0                   	// #0
  400934:	f8737aa3 	ldr	x3, [x21, x19, lsl #3]
  400938:	aa1603e2 	mov	x2, x22
  40093c:	aa1703e1 	mov	x1, x23
  400940:	2a1803e0 	mov	w0, w24
  400944:	91000673 	add	x19, x19, #0x1
  400948:	d63f0060 	blr	x3
  40094c:	eb13029f 	cmp	x20, x19
  400950:	54ffff21 	b.ne	400934 <__libc_csu_init+0x44>  // b.any
  400954:	a94153f3 	ldp	x19, x20, [sp, #16]
  400958:	a9425bf5 	ldp	x21, x22, [sp, #32]
  40095c:	a94363f7 	ldp	x23, x24, [sp, #48]
  400960:	a8c47bfd 	ldp	x29, x30, [sp], #64
  400964:	d65f03c0 	ret

0000000000400968 <__libc_csu_fini>:
  400968:	d65f03c0 	ret

Disassembly of section .fini:

000000000040096c <_fini>:
  40096c:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  400970:	910003fd 	mov	x29, sp
  400974:	a8c17bfd 	ldp	x29, x30, [sp], #16
  400978:	d65f03c0 	ret
